<template>
	<view class="service-provider full box relative bg-white flex-col p-safe">
		<view class="w-wrap">
			<view class="w-inner">
				<scroll-view scroll-y="true" class="full">
					<view class="form-wrapper">
						<u-form label-position="top" :model="formData" :rules="formRules" ref="formRef">
							<u-form-item label="个人姓名" prop="name">
								<u-input v-model="formData.name" placeholder="请输入个人姓名" />
							</u-form-item>
							<u-form-item label="手机号" prop="phone">
								<u-input v-model="formData.phone" placeholder="请输入手机号" />
							</u-form-item>
							<u-form-item label="身份证号" prop="phone">
								<u-input type="idcard" v-model="formData.phone" placeholder="请输入身份证号" />
							</u-form-item>
							<u-form-item label="备用机收货地址" prop="address">
								<u-input v-model="formData.address" placeholder="请输入备用机收货地址" />
							</u-form-item>
							<u-form-item label="详细地址" prop="addressDetail">
								<u-input v-model="formData.addressDetail" placeholder="请输入详细地址" />
							</u-form-item>
							<u-form-item label="服务区域" prop="addressDetail">
								<u-input v-model="formData.addressDetail" placeholder="请输入服务区域" />
							</u-form-item>
							<u-form-item :border-bottom="false" label="上传身份证正反面" prop="addressDetail">
								<view class="upload-box">
									<view class="upload-item">
										<text class="upload-label">正面照片</text>
										<u-icon size="44rpx" color="#86909c" name="plus" />
									</view>
									<view class="upload-item">
										<text class="upload-label">反面照片</text>
										<u-icon size="44rpx" color="#86909c" name="plus" />
									</view>
								</view>
							</u-form-item>
						</u-form>

					</view>
				</scroll-view>
			</view>
		</view>
		<view class="footer-wrapper">
			<u-button shape="circle" type="primary">提交申请</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				seconds: 10,
				formData: {
					name: "",
					phone: "",
					password: "",
					passwordConfirm: "",
					address: "",
					remark: "",
					code: "",
					addressDetail: ""
				},
				codeText: "",
				addressValue: ""
			}
		},
		computed: {
			formRules() {
				return {
					name: [{
						required: true,
						message: '请输入加盟人姓名',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					phone: [{
						required: true,
						message: '请输入加盟人电话',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					code: [{
						required: true,
						message: '请输入验证码',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					password: [{
						required: true,
						message: '请输入系统登录密码',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					passwordConfirm: [{
						required: true,
						message: '请再次输入密码',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					address: [{
						required: true,
						message: '请选择水管家自用机收货地址',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					addressDetail: [{
						required: true,
						message: '请输入详细地址',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
				}
			}
		},
		methods: {},
	}
</script>

<style lang="scss" scoped>
	.service-provider {
		.footer-wrapper {
			padding: 16rpx 32rpx;
		}

		.upload-box {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			margin-top: 24rpx;

			.upload-item {
				display: flex;
				flex-flow: column;
				align-items: center;
				width: 160rpx;
				height: 160rpx;
				background: #F3F3F3;
				justify-content: center;

				&:first-child {
					margin-right: 110rpx;
				}

				.upload-label {
					font-size: 22rpx;
					color: #5A5A5A;
					line-height: 48rpx;
				}
			}
		}

		.form-wrapper {
			padding: 24rpx 32rpx;

			::v-deep .u-input__input {
				font-size: 32rpx !important;
			}

			::v-deep .u-form-item--left {
				line-height: 40rpx !important;
				font-size: 32rpx;
				color: #1D2129;
				line-height: 48rpx;
			}
		}
	}
</style>